package com.bw.liuyushan.mykotlin_firstmvptest.MVP.Model

import android.util.Log
import com.bw.liuyushan.mvp_kotlin_lib.Model.BaseModel
import com.bw.liuyushan.mykotlin_firstmvptest.MVP.Contrack.IContrackTest
import com.bw.liuyushan.mykotlin_firstmvptest.MVP.Entity.Food
import com.bw.liuyushan.mykotlin_firstmvptest.Utils.FoodApi
import com.bw.liuyushan.mykotlin_firstmvptest.Utils.RxJavaManager
import io.reactivex.Observer
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers

/**
 *MyKotlin_FirstMVPTest
 *file name is : BaseModelTest
 *created by Ender on 2021/9/14 19:27.
 *author : 刘雨杉
 *Describe:
 */
class BaseModelTest : BaseModel(),IContrackTest.C_ModelTest{
    override fun askDate(url: String, observer: Observer<Food>) {
        RxJavaManager.instance.getRetrofit().create(FoodApi ::class.java)
            .getFood(url)
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(observer)
    }

}